﻿using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace Himp.Platform.Dc.EntityFrameworkCore;

[ConnectionStringName(DcDbProperties.ConnectionStringName)]
public class DcDbContext : AbpDbContext<DcDbContext>, IDcDbContext
{
    /* Add DbSet for each Aggregate Root here. Example:
     * public DbSet<Question> Questions { get; set; }
     */


    public DbSet<StdWordDict> StdWordDicts { get; set; }

    #region cores

    public DbSet<BizSeq> BizSeqs { get; set; }

    #endregion

    #region Diags

    /// <summary>
    /// 临床诊断字典
    /// </summary>
    public DbSet<ClncDiagDict> ClncDiagDicts { get; set; }

    /// <summary>
    /// 诊断类别字典
    /// </summary>
    public DbSet<DiagTypeDict> DiagTypeDicts { get; set; }

    /// <summary>
    /// 医保诊断字典
    /// </summary>
    public DbSet<HiDiagDict> HiDiagDicts { get; set; }

    /// <summary>
    /// 中医疾病字典
    /// </summary>
    public DbSet<TcmDiseDict> TcmDiseDicts { get; set; }

    /// <summary>
    /// 中医症候字典
    /// </summary>
    public DbSet<TcmsympDict> TcmsympDicts { get; set; }

    #endregion

    #region 公共项目

    public DbSet<PubItemType> PubItemTypes { get; set; }

    public DbSet<PubItem> PubItems { get; set; }

    public DbSet<ChrgitmType> ChrgitmTypes { get; set; }

    public DbSet<ChrgitmTypeGrp> ChrgitmTypeGrps { get; set; }

    #endregion

    #region 药品

    /// <summary>
    /// 药品类别
    /// </summary>
    public DbSet<DrugType> DrugTypes { get; set; }

    /// <summary>
    /// 药理分类
    /// </summary>
    public DbSet<PhamType> PhamTypes { get; set; }

    /// <summary>
    /// 药品厂商
    /// </summary>
    public DbSet<DrugPrdr> DrugPrdrs { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<DrugDosform> DrugDosforms { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<DrugMedcWay> DrugMedcWays { get; set; }

    #endregion

    #region 处方

    public DbSet<RxUsedFrqu> RxUsedFrqus { get; set; }


    #endregion

    public DcDbContext(DbContextOptions<DcDbContext> options)
        : base(options)
    {
        
    }

    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);

        builder.ConfigureDc();
    }
}
